import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { meetingRoomGoodsVO, meetingRoomGoodsForm, meetingRoomGoodsQuery } from '@/api/efficient-office/meeting-room-goods/types';

/**
 * 查询会议室-商品列表
 * @param query
 * @returns {*}
 */

export const listmeetingRoomGoods = (query?: any): AxiosPromise<any[]> => {
  return request({
    url: '/meeting-room/meeting-room-goods/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询会议室-商品详细
 * @param meetingRoomGoodsId
 */
export const getmeetingRoomGoods = (meetingRoomGoodsId: string | number): AxiosPromise<meetingRoomGoodsVO> => {
  return request({
    url: '/meeting-room/meeting-room-goods/' + meetingRoomGoodsId,
    method: 'get'
  });
};

/**
 * 新增会议室-商品
 * @param data
 */
export const addmeetingRoomGoods = (data: meetingRoomGoodsForm) => {
  return request({
    url: '/meeting-room/meeting-room-goods',
    method: 'post',
    data: data
  });
};

/**
 * 修改会议室-商品
 * @param data
 */
export const updatemeetingRoomGoods = (data: meetingRoomGoodsForm) => {
  return request({
    url: '/meeting-room/meeting-room-goods',
    method: 'put',
    data: data
  });
};

/**
 * 删除会议室-商品
 * @param meetingRoomGoodsId
 */
export const delmeetingRoomGoods = (meetingRoomGoodsId: string | number | Array<string | number>) => {
  return request({
    url: '/meeting-room/meeting-room-goods/' + meetingRoomGoodsId,
    method: 'delete'
  });
};
